#ifndef __trie_h__
#define __trie_h__

typedef struct _trie_node
{
    int32 flag;
    struct _trie_node* child[256];
} trie_node;

typedef struct _trie
{
    trie_node* root;
    uint32 cword;
} trie;

trie* trie_create();
int32 trie_insert( trie* tr, const char* word, int32 flag );
int32 trie_remove( trie* tr, const char* word );
char* trie_match( trie* tr, char* src, int32* flag );
void trie_destroy( trie* tr );

#endif // __trie_h__
